package com.example.bbbb.funIn;

import java.util.Objects;
import java.util.function.Consumer;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-12-24
 * Time: 22:01
 */

@FunctionalInterface// 仅需加上该注解
public interface MyInterface {
    public abstract String doSth();// 内部只能有一个抽象方法
}


class T{
    public static void main(String[] args) {
//        MyInterface myInterface = new MyInterface() {
//            @Override
//            public String doSth() {
//                return null;
//            }
//        };

       MyInterface myInterface = () -> {
           return "doSth";
       };

        System.out.println(myInterface.doSth());

    }
}


